package cc.loach.homekit.hap.controlled.device.loach._lightbulb._light;

import cc.loach.homekit.hap.typedef.accessory.HapAccessory;
import cc.loach.xiot.spec.definition.urn.DeviceType;
import cc.loach.homekit.hap.controlled.device.loach._lightbulb._light._accessoryinformation.AccessoryInformation;
import cc.loach.homekit.hap.controlled.device.loach._lightbulb._light._lightbulb.Lightbulb;
import cc.loach.homekit.hap.controlled.device.loach._lightbulb._light._protocolinformation.ProtocolInformation;

/**
 * 普通灯泡_TS
 */
public class HapLight extends HapAccessory {

    public static final String TYPE = "urn:homekit-spec:device:lightbulb:00000005:loach:light:1";

    public HapLight(String did) {
        this();
        super.did(did);
    }

    public HapLight() {
        super(new DeviceType(TYPE));
        super.services().put(AccessoryInformation.IID, new AccessoryInformation());
        super.services().put(Lightbulb.IID, new Lightbulb());
        super.services().put(ProtocolInformation.IID, new ProtocolInformation());
    }

    /**
     * 配件信息
     */
    public AccessoryInformation _accessoryInformation() {
        return (AccessoryInformation) services().get(AccessoryInformation.IID);
    }

    /**
     * 灯泡
     */
    public Lightbulb _lightbulb() {
        return (Lightbulb) services().get(Lightbulb.IID);
    }

    /**
     * 协议信息
     */
    public ProtocolInformation _protocolInformation() {
        return (ProtocolInformation) services().get(ProtocolInformation.IID);
    }

}
